<?php

class Core_Mail extends Zend_Mail
{

	public function __construct( $charset = 'utf-8' ) {
		parent::__construct( $charset );

		$config = Zend_Registry::get('config');

		$conf = array( 
			'auth'     => 'login', 
			'username' => $config['email']['username'],
			'password' => $config['email']['password'],
			'port'	   => $config['email']['port']
		);

		self::setDefaultTransport( new Zend_Mail_Transport_Smtp(
			$config['email']['smtp'], 
			$conf
		) );
	}
}
